package com.cardone.platform.authority.service;

import java.util.List;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.transaction.annotation.Transactional;

import com.cardone.common.cache.Caches;
import com.cardone.common.dto.PaginationDto;
import com.cardone.platform.authority.dto.UserGroupDto;

/**
 * 用户组服务
 *
 * @author yaohaitao
 */
public interface UserGroupService {
	/**
	 * spring bean id
	 */
	String BEAN_ID = "com.cardone.platform.authority.service.UserGroupService";

	/**
	 * 保存:用户组
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param saveUserGroup
	 *          用户组对象
	 *
	 * @return 用户组对象
	 */
	@Deprecated
	@Transactional
	@CacheEvict(value = UserGroupService.BEAN_ID, allEntries = true)
	<P> P saveByIdOrCode(final Class<P> mappedClass, final UserGroupDto saveUserGroup);

	/**
	 * 插入
	 *
	 * @param insertUserGroup
	 *          用户组对象
	 *
	 * @return 影响行数
	 */
	@Deprecated
	@Transactional
	@CacheEvict(value = UserGroupService.BEAN_ID, allEntries = true)
	int insertByCode(final UserGroupDto insertUserGroup);

	/**
	 * 删除
	 *
	 * @param deleteUserGroup
	 *          用户组对象
	 *
	 * @return 影响行数
	 */
	@Deprecated
	@Transactional
	@CacheEvict(value = UserGroupService.BEAN_ID, allEntries = true)
	int deleteByIds(final UserGroupDto deleteUserGroup);

	/**
	 * 更新
	 *
	 * @param updateUserGroup
	 *          用户组对象
	 *
	 * @return 影响行数
	 */
	@Deprecated
	@Transactional
	@CacheEvict(value = UserGroupService.BEAN_ID, allEntries = true)
	int updateByCode(final UserGroupDto updateUserGroup);

	/**
	 * 查询
	 *
	 * @param readUserGroup
	 *          用户组对象
	 * @return 返回数据
	 */
	@Deprecated
	@Cacheable(value = UserGroupService.BEAN_ID, key = Caches.KEY_1)
	Integer readByCodeNqIdForCount(final UserGroupDto readUserGroup);

	/**
	 * 查询
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param findUserGroup
	 *          用户组对象
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = UserGroupService.BEAN_ID, key = Caches.KEY_2)
	<P> P findById(final Class<P> mappedClass, final UserGroupDto findUserGroup);

	/**
	 * 查询
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param findUserGroup
	 *          用户组对象
	 *
	 * @return 返回对象
	 */
	@Deprecated
	@Cacheable(value = UserGroupService.BEAN_ID, key = Caches.KEY_2)
	<P> P findByCodeOrId(final Class<P> mappedClass, final UserGroupDto findUserGroup);

	/**
	 * 查询
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param findListUserGroup
	 *          用户组对象
	 *
	 * @return 用户组对象集合
	 */
	@Deprecated
	@Cacheable(value = UserGroupService.BEAN_ID, key = Caches.KEY_2)
	<P> List<P> findListByLikeCode(final Class<P> mappedClass, final UserGroupDto findListUserGroup);

	/**
	 * 分页
	 *
	 * @param mappedClass
	 *          返回类型
	 *
	 * @param paginationUserGroup
	 *          用户组对象
	 *
	 * @return 用户组分页对象
	 */
	@Deprecated
	@Cacheable(value = UserGroupService.BEAN_ID, key = Caches.KEY_2)
	<P> PaginationDto<P> paginationByLikeCode(final Class<P> mappedClass, final UserGroupDto paginationUserGroup);
}